//获取应用实例
let app = getApp();
let httptool=require("../../../utils/zry.httptool.js");
Page({
  data: {
    totalScore:{},
    msgprop:'',//消息提示 
    UserId:0,
    checktype:0
  },
  onLoad:function(options){
    // 页面初始化 options为页面跳转所带来的参数
    let that=this;
    let userid=options.userid;
    let checktype=options.checktype;
    if(checktype==1){
      that.setData({UserId:userid});
      console.log(that.data.UserId);
    }else{
      that.setData({UserId:app.getStorage('customerId')});
    }
    that.getScoreTotal(); 
  },
 getScoreTotal:function(e){
   let that=this;
    httptool.ajaxPost("api/Customer/GetScoreTotal", {UserId:that.data.UserId},function(res){
    if(res.suc){
        let data = res.data;
        that.setData({totalScore: data});
    }else{
      app.showNotify(that, res.msg);
    }
  });
 },
 getHisdata:function(e){
   wx.navigateTo({
     url: '/pages/myCenter/community/community',
   })
 }
})